home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 2
/
AACD 2.iso
/
AACD
/
WebSites
/
MailingLists
/
AMOSLIST.0699
/
000129_nobody_Wed Jun 30 13:52:35 1999.msg
< prev
next >
Wrap
Internet Message Format
|
1999-07-02
|
3KB
Received: from onelist.com (pop.onelist.com [209.207.164.31])
by osf1.gmu.edu (8.8.8/8.8.8) with SMTP id NAA27447
for <mcox4@osf1.gmu.edu>; Wed, 30 Jun 1999 13:52:34 -0400 (EDT)
Received: (qmail 32394 invoked by alias); 30 Jun 1999 17:52:07 -0000
Received: (qmail 32360 invoked from network); 30 Jun 1999 17:52:06 -0000
Received: from unknown (HELO web905.mail.yahoo.com) (128.11.23.80) by pop.onelist.com with SMTP; 30 Jun 1999 17:52:06 -0000
Message-ID: <19990630175229.23047.rocketmail@web905.mail.yahoo.com>
Received: from [62.188.134.243] by web905.mail.yahoo.com; Wed, 30 Jun 1999 18:52:29 BST
Date: Wed, 30 Jun 1999 18:52:29 +0100 (BST)
From: =?iso-8859-1?q?Claude=20Heiland-Allen?= <cheilandallen@yahoo.co.uk>
To: amos-list@onelist.com
Mailing-List: list amos-list@onelist.com; contact amos-list-owner@onelist.com
Delivered-To: mailing list amos-list@onelist.com
Precedence: bulk
List-Unsubscribe: <mailto:amos-list-unsubscribe@ONElist.com>
Reply-to: amos-list@onelist.com
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Subject: Re: [amos-list] Seemingly easy task...
Status: O
X-Status:
From: =?iso-8859-1?q?Claude=20Heiland-Allen?= <cheilandallen@yahoo.co.uk>
Hi
I found the algorithm for drawing a circle, here it is
in
pseudo-code. I haven't actually tested this, but it
should
work. It is Michener's algorithm, from
"Fundamentals of Interactive Computer Graphics"
(c) 1982-3 J D Foley, A van Dam.
(This book has everything - from low level line
drawing up
to raytracing.)
All variables are integers. Just don't ask me how the
thing
actually works...
-->8--------------------------------------------------------
procedure circle(cx, cy, radius, pen)
// consider the first 1/8 of the circle
x = 0
y = radius
d = 3 - 2 * radius
while x < y
circlepoints(cx, cy, x, y, pen)
if d < 0
d = d + 4 * x + 6
else
d = d + 4 * (x - y) + 10
y = y - 1
endif
x = x + 1
endwhile
if x = y then circlepoints(cx, cy, x, y, pen)
endprocedure
procedure circlepoints(cx, cy, x, y, pen)
// plot 8 points on the circle, by symmetry
plot(cx + x, cy + y, pen)
plot(cx + x, cy - y, pen)
plot(cx - x, cy + y, pen)
plot(cx - x, cy - y, pen)
plot(cx + y, cy + x, pen)
plot(cx + y, cy - x, pen)
plot(cx - y, cy + x, pen)
plot(cx - y, cy - x, pen)
endprocedure
-->8--------------------------------------------------------
Anyway, why do you need to draw circles? Why not use
the OS
functions directly - they should be the fastest.
Good luck anyway.
Claude
_____________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
--------------------------- ONElist Sponsor ----------------------------
Campaign 2000 is here!
http://www.onelist.com
Discuss your thoughts; get informed at ONElist. See our homepage.
------------------------------------------------------------------------
Official AMOS WWW: http://members.xoom.com/AmosFactory/front.html